@import url('https://fonts.googleapis.com/css?family=Lilita+One');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1d1d26;
}

.containter {
    perspective: 500px;
    transform-style: preserve-3d;

    &>.text {
        transform-style: preserve-3d;
        transform: rotateY(0deg) rotateX(30deg);
        animation: ani 5s infinite alternate ease-in-out forwards;

        &:after {
            content: "IndulgeBack";
            position: absolute;
            font: 10vw/0.65 "Lilita One";
            white-space: nowrap;
            color: #ddd;
            transform: translateX(-50%);
            text-shadow: -10px 10px 4px rgba(0, 0, 0, 0.08);
        }

        @for $i from 1 through 15 {
            &:nth-child(#{$i})::after {
                transform: translateZ(-$i * 3px) translateX(-50%) translateY(0);
            }
        }

        &:first-child::after {
            color: #fff;
            text-shadow: none;
        }
    }
}

@keyframes ani {
    20% {
        transform: rotateY(0deg) rotateX(-30deg);
    }

    40% {
        transform: rotateY(0deg) rotateX(30deg);
    }

    60% {
        transform: rotateY(30deg) rotateX(30deg);
    }

    80% {
        transform: rotateY(-30deg) rotateX(30deg);
    }

    100% {
        transform: rotateY(0deg) rotateX(0deg);
    }
}